from rest_framework import serializers
from goods.models import GoodsVisitCount


class Categoryserializer(serializers.Serializer):
    name=serializers.CharField()

class GoodsVisitCountSerialzier(serializers.ModelSerializer):

    category = serializers.StringRelatedField(read_only=True)
    # category = Categoryserializer()

    class Meta:
        model = GoodsVisitCount
        fields = ('category', 'count')
